import java.util.Scanner;

public class demo05 {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        long k=sc.nextInt();
        long left=1;
        long right=(long)9e18;
        while (left<right){
            long mid=(left+right)/2;
            if(check(mid)>=k){
                right=mid;
            }else{
                left=mid+1;
            }
        }
        if(check(right)==k){
            System.out.println(left);
        }else{
            System.out.println(-1);
        }
    }
    public static long check(long num){
        long count=0;
        while (num!=0){
            count+=num/5;
            num/=5;
        }
        return count;
    }
}
